package com.itheima.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itheima.domain.Book;

import java.util.List;

/**
 * className: BookService
 * description:
 * date: 2023/2/22 0022-PM 10:56:45
 * <p>
 * project: springboot
 * package: com.itheima.service
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public interface BookService {
    /**
     * 保存
     *
     * @param book {@link Book} object
     * @return {@link Boolean}
     */
    Boolean save(Book book);

    /**
     * 更新
     *
     * @param book {@link Book} object
     * @return {@link Boolean}
     */
    Boolean update(Book book);

    /**
     * 删除
     *
     * @param id {@link Integer} id of the book
     * @return {@link  Boolean}
     */
    Boolean delete(Integer id);

    /**
     * 根据 id 查询
     *
     * @param id {@link Integer} id of the book
     * @return {@link Book} object
     */
    Book getById(Integer id);

    /**
     * 获取所有结果
     *
     * @return {@link List<Book>} result
     */
    List<Book> getAll();

    /**
     * 分页查询
     *
     * @param currentPage {@link Integer}
     * @param pageSize    {@link Integer}
     * @return {@link IPage<Book>}
     */
    IPage<Book> getPage(int currentPage, int pageSize);
}
